Refactor 41757 for MS functions#8476
Conversation
|
Hi @SirLouen! 👋 Thank you for your contribution to WordPress! 💖 It looks like this is your first pull request to No one monitors this repository for new pull requests. Pull requests must be attached to a Trac ticket to be considered for inclusion in WordPress Core. To attach a pull request to a Trac ticket, please include the ticket's full URL in your pull request description. Pull requests are never merged on GitHub. The WordPress codebase continues to be managed through the SVN repository that this GitHub repository mirrors. Please feel free to open pull requests to work on any contribution you are making. More information about how GitHub pull requests can be used to contribute to WordPress can be found in the Core Handbook. Please include automated tests. Including tests in your pull request is one way to help your patch be considered faster. To learn about WordPress' test suites, visit the Automated Testing page in the handbook. If you have not had a chance, please review the Contribute with Code page in the WordPress Core Handbook. The Developer Hub also documents the various coding standards that are followed:
Thank you, |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
peterwilsoncc
left a comment
There was a problem hiding this comment.
I've added a few notes inline.
| * @param int $user_id | ||
| * @param mixed $password Accessible via 'added_new_user_to_blog' hook. | ||
| * @param array $meta |
There was a problem hiding this comment.
Descriptions for user_id and meta will need to be retained, password is still a string.
| /** | ||
| * Fires when a new user is added to a network site without an error from $result. | ||
| * | ||
| * @since 4.9.0 |
There was a problem hiding this comment.
| * @since 4.9.0 | |
| * @since 6.9.0 |
| * @param array $meta Array of meta data from the new registration. | ||
| * @param int $blog_id Blog ID. | ||
| */ | ||
| do_action( 'added_new_user_to_blog', $user_id, $password, $meta, $blog_id ); |
There was a problem hiding this comment.
Naming things: I'd go with the following as I think it a better practice to use the wp_ prefix followed by the name of the function. I care more about the prefix that changing added to add.
| do_action( 'added_new_user_to_blog', $user_id, $password, $meta, $blog_id ); | |
| do_action( 'wp_add_new_user_to_blog', $user_id, $password, $meta, $blog_id ); |
| update_user_meta( $user_id, 'primary_blog', $blog_id ); | ||
|
|
||
| /** | ||
| * Fires when a new user is added to a network site without an error from $result. |
There was a problem hiding this comment.
| * Fires when a new user is added to a network site without an error from $result. | |
| * Fires when a new user is successfully added to a network site. |
Trac ticket: https://core.trac.wordpress.org/ticket/41757
Given that the original patch was posted 8 years ago some little modifications have occurred in the function hence the patch is not working anymore. Here is an updated PR with the updated patch with the same contents.
Props to /johnjamesjacoby /jeremyfelt and /danieltj
More info in the Trac report.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.